import title from './components/Title/index'
import deleteDialog from './components/DeleteDialog/index'
import MyThemeCard from './components/MyThemeCard/index'
import { setDefaultTheme, setImageTheme } from '@/utils/theme'
import store from '@/store'

export function register(vue) {
  if (vue) {
    // 标题
    vue.component('my-title', title)
    // 删除弹框
    vue.component('my-delete-dialog', deleteDialog)
    // theme card
    vue.component('my-theme-card', MyThemeCard)
  }
}

export function themeSet() {
  const custom_themes = store.state.settings.custom_themes
  if (custom_themes === 'default') {
    setDefaultTheme()
  } else if (custom_themes === 'image') {
    setImageTheme()
  }
}
